     
   
$(function(){
    
    $(".form_datetime").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
todayBtn: true,
pickerPosition: "bottom-left"
});
    $(window).resize(function(){
        size();
    });
    function size(){
        //				中间部分高度
    $(".container1").height($(window).height()-$(".header").height()-$("#top").height()-$(".footer").height());
        //				嵌套区域宽度
    $(".multi_page_container").width($(window).width()-$(".nav2").width());
    // $(".multi_page_container").height($(".container").height()-7);
    // var multiLeaderHeight=$(".multi_one_page:visible").find(".multi_leader")[0].offsetHeight;
    var multiLeaderHeight=$(".multi_leader").offsetHeight;
    $(".multi_iframe_div").height($(".multi_page_container").height()-multiLeaderHeight-40);
    }
    size();
var flag=false;
$(".nav2").on("click", ".cols", function(){
hidenav2();
});
function hidenav2(){

if(!flag){
  $(".nav2").css("width",1);
$(".nav2 .cols").css("left",1);
$(".multi_tab_container").css("margin-left",1);
$(".multi_page_container").css("margin-left",1);
$(".multi_page_container").width($(window).width()-$(".nav2").width());	
           flag=true;
      }else{
          $(".nav2").css("width",85);
$(".nav2 .cols").css("left",85);
      $(".multi_tab_container").css("margin-left",85);
$(".multi_page_container").css("margin-left",85);
$(".multi_page_container").width($(window).width()-$(".nav2").width());
           flag=false;
      }


}
$(".accordion li").click(function(){ 

$(this).addClass('act').siblings('li').removeClass('act'); 
var index = $(this).index(); 
//显示对应的div 
$('.Bs').eq(index).show().siblings('div').hide(); 
})
  $(".Overview-last").click(function(){
      console.log(123)
      $(".Overview-right").toggleClass("show");
      $(".Overview-right2").toggleClass("show");
      $(this).toggleClass("Overview-pert");
  }) 
 
// var worldMapContainer = document.getElementById('chart');

// //用于使chart自适应高度和宽度,通过窗体高宽计算容器高宽
// var resizeWorldMapContainer = function () {
//     worldMapContainer.style.width = window.innerWidth + 'px';
//     worldMapContainer.style.height = window.innerHeight + 'px';
//     //rem单位
//     //worldMapContainer.style.width = window.innerWidth/750*690+'px';
//     //worldMapContainer.style.height = window.innerHeight/750*600+'px';
// };
// window.addEventListener("resize", function () {
  

//     chart1.resize();
//     chart2.resize();
//     chart3.resize();
//     chart4.resize();
//     chart5.resize();
// });
//   贫困人占比 饼图
option1 = {
    title : {
        // text: '某站点用户访问来源',
        // subtext: '纯属虚构',
        // x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        // left: 'left',
        // data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series : [
        {
            name: '访问来源',
            type: 'pie',
            radius : '55%',
            center: ['45%', '50%'],
            data:[
                {value:310, name:'直接访问'},
                {value:500, name:'邮件营销'},
                {value:234, name:'未脱贫人数'},
                {value:135, name:'返贫人数'},
              
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            },
            label: {
                normal: {
                    textStyle: {
                        color: 'rgba(255, 255, 255, 1)'
                    }
                }
            },
        }
    ],
    color:['#03dd9f','#4c8bff','#e569ff','#feb46f']
};
var chart1=echarts.init(document.getElementById("chart1"));
chart1.setOption(option1);
//  用于使chart自适应高度和宽度
 window.onresize = function () {
    //重置容器高宽
    resizeWorldMapContainer();
    chart1.resize();
};
// 致贫原因 柱状图 
 

    option2 = {
        tooltip : {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow',
                // label: {
                //     show: true
                // }
            }
        },
        // toolbox: {
        //     show : true,
        //     feature : {
        //         mark : {show: true},
        //         dataView : {show: true, readOnly: false},
        //         magicType: {show: true, type: ['line', 'bar']},
        //         restore : {show: true},
        //         saveAsImage : {show: true}
        //     }
        // },
        calculable : true,
        legend: {
            data:['Growth', 'Budget 2011', 'Budget 2012'],
            itemGap: 5
        },
        // grid: {
        //     // top: '12%',
        //     // left: '1%',
        //     // right: '10%',
        //     bottom:40,
        //     containLabel: true
        // },
        xAxis: [
            {
                type : 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
                axisLine:{
                    lineStyle:{color:'#fff'}
                   },
                   axisTick:{       //y轴刻度线
                    "show":false
                  },
            }
        ],
        yAxis: [
            {
                type : 'value',
                name : '111)',
                max: 1500,
                min: 0,
                axisLine:{
                          lineStyle:{color:'#fff'}  //y轴坐标轴颜色
                         },
                         axisTick:{       //y轴刻度线
                            "show":false
                          },
              
       
              
            }
        ],
        dataZoom: [
            {
                show: true,
                start: 0,
                end: 100
            },
            // {
            //     type: 'inside',
            //     start: 94,
            //     end: 100
            // },
            {
                show: false,
                yAxisIndex: 0,
                filterMode: 'empty',
                width: 30,
                height: '80%',
                showDataShadow: false,
                left: '93%'
            }
        ],
        series : [
            {
                name: 'Budget 2011',
                barGap:'10%',
                type: 'bar',
                barWidth : 20,
                // itemStyle:{ normal:{ color:'#816ec1' } },
                data:[
                    {value:335, name:'直接访问'},
                    {value:310, name:'邮件营销'},
                    {value:234, name:'联盟广告'},
                    {value:135, name:'视频广告'},
                    {value:1548, name:'搜索引擎'}
                ],
                
                itemStyle: {
                    normal: {
                        label: {
                            show: true, //开启显示
                            position: 'top', //在上方显示
                            textStyle: { //数值样式
                                color: '#fff',
                                fontSize: 12,
                            }
                        },
                        color:'#816ec1'
                    }
                },
            },
            {
                name: 'Budget 2012',
                type: 'bar',
                barWidth : 20,
                data:[
                    {value:335, name:'直接访问'},
                    {value:310, name:'邮件营销'},
                    {value:234, name:'联盟广告'},
                    {value:135, name:'视频广告'},
                    {value:1548, name:'搜索引擎'}
                ],
                itemStyle: {
                    normal: {
                        label: {
                            show: true, //开启显示
                            position: 'top', //在上方显示
                            textStyle: { //数值样式
                                color: '#fff',
                                fontSize: 12,
                            }
                        },
                        color:'#cd7ee7'
                    }
                },
              
            }
        ]
    };

    var chart2=echarts.init(document.getElementById("chart2"));
    chart2.setOption(option2);
     //用于使chart自适应高度和宽度
     window.onresize = function () {
        //重置容器高宽
        resizeWorldMapContainer();
        chart2.resize();
    };
//  目标完成情况 折线图
    option3 = {
        grid:{
            bottom:40
        },
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
            axisLine:{
                lineStyle:{color:'#fff'}  //y轴坐标轴颜色
               },
               axisTick:{       //y轴刻度线
                  "show":false
                },
              
        },
        yAxis: {
            type: 'value',
            name : '(%)',
            axisLine:{
                lineStyle:{color:'#fff'}  //y轴坐标轴颜色
               },
               axisTick:{       //y轴刻度线
                  "show":false
                },
                splitLine: {
                    show: true,
                    lineStyle:{
                         width: 1,
                        type: 'dotted',
                      
                    }
                }
    
    
        },
        series: [{
            data: [820, 932, 901, 934, 1290, 1330],
            type: 'line',
            itemStyle: {
                normal: {
                    color: '#ff9700',
                    
                }
            },
           
        }]
    };
    var chart3 =echarts.init(document.getElementById("chart3"));
    chart3.setOption(option3);
    //  //用于使chart自适应高度和宽度
     window.onresize = function () {
        //重置容器高宽
        // resizeWorldMapContainer();
        chart3.resize();
    };
// 帮扶人工作量 折线图
option4 = {
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['视频广告','直接访问','搜索引擎'],
        itemWidth: 30,
        itemHeight: 10,
        itemGap: 30,
        textStyle: {
            fontSize: 12,
            color: '#fff'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        axisLine:{
            lineStyle:{color:'#fff'}  //y轴坐标轴颜色
           },
    },
    yAxis: {
        type: 'value',
        max: 1200,
        min: 0,
        splitLine: {
            show: true,
            lineStyle:{
                 width: 1,
                type: 'dotted',
              
            }
        },
        axisLine:{
            lineStyle:{color:'#fff'}  //y轴坐标轴颜色
           },

       
    },
    series: [
        {
            name:'视频广告',
            type:'line',
            stack: '总量',
            data:[150, 232, 201, 154, 190, 330, 410],
            itemStyle: {
                normal: {
                    color: '#ff9700',
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                          color: 'white'
                    }
                 }
                    
                }
            },
        },
        {
            name:'直接访问',
            type:'line',
            stack: '总量',
            data:[320, 332, 301, 334, 390, 330, 320],
            itemStyle: {
                normal: {
                    color: '#b928ca',
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                          color: 'white'
                    }
                 }
                    
                }
            },
       
        },
        {
            name:'搜索引擎',
            type:'line',
            stack: '总量',
            data:[82, 93, 90, 93, 100, 133, 320],
            itemStyle: {
                normal: {
                    color: '#5ca3cc',
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                          color: 'white'
                    }
                 }
                    
                }
            },
        }
    ]
};
var chart4 =echarts.init(document.getElementById("chart4"));
chart4.setOption(option4);

setInterval(function(){
    // $('#mb-overcome').css('width',($('.mb-long-hold').width()-40));
    $('#chart4').css('height',($('.chartBox').height()))
    $('#chart4').css('width',($('.chartBox').width()))
    chart4.resize();
},200)
chart4.on('click', function (params) {
    console.log(params);
    // $('body').dailog({type:'success',maskBg:'rgba(88,11,22,0.5)'})
    $('#check_zhixing').dialog('open');
    
});

// 帮扶单位工作量 折线图*
option5 = {
   
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['视频广告','搜索引擎'],
        itemWidth: 30,
        itemHeight: 10,
        itemGap: 30,
        textStyle: {
            fontSize: 12,
            color: '#fff'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        axisLine:{
            lineStyle:{color:'#fff'}  //y轴坐标轴颜色
           },
    },
    yAxis: {
        type: 'value',
        max: 1800,
        min: 0,
        splitLine: {
            show: true,
            lineStyle:{
                 width: 1,
                type: 'dotted',
              
            }
        },
        axisLine:{
            lineStyle:{color:'#fff'}  //y轴坐标轴颜色
           },

       
    },
    series: [
        {
            name:'视频广告',
            type:'line',
            stack: '总量',
            data:[150, 232, 201, 154, 190, 330, 410],
            itemStyle: {
                normal: {
                    color: '#ff9700',
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                          color: 'white'
                    }
                 }
                    
                }
            },
        },
        {
            name:'搜索引擎',
            type:'line',
            stack: '总量',
            data:[82, 93, 90, 93, 100, 133, 320],
            itemStyle: {
                normal: {
                    color: '#5ca3cc',
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                          color: 'white'
                    }
                 }
                    
                }
            },
        }
    ]
};
var chart5 =echarts.init(document.getElementById("chart5"));
chart5.setOption(option5);
setInterval(function(){
    // $('#mb-overcome').css('width',($('.mb-long-hold').width()-40));
    $('#chart5').css('height',($('.chartBox').height()))
    $('#chart5').css('width',($('.chartBox').width()))
    chart5.resize();
},200)


 //进度条
 $('#progressbar3').LineProgressbar({
      percentage: 61,
	  fillBackgroundColor: '#03dd9f',
      height: '20px',
      radius: '50px',
      width:'80%',
  });
  var nice = $("html").niceScroll();  // The document page (body)

	

	$("#div1").html($("#div1").html()+' '+nice.version);

    

    $("#boxscroll").niceScroll({cursorborder:"",cursorcolor:"#999",boxzoom:true}); // First scrollable DIV
    $("#boxscroll1").niceScroll({cursorborder:"",cursorcolor:"#999",boxzoom:true});
})

